package abstractEntities;

import java.util.Date;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.MappedSuperclass;
import javax.persistence.OneToMany;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import org.hibernate.annotations.GenericGenerator;

import entities.Departament;
import entities.Teamranking;
import entities.User;
import entities.Userteam;

/**
 * AbstractTeam entity provides the base persistence definition of the Team
 * entity. @author MyEclipse Persistence Tools
 */
@MappedSuperclass
public abstract class AbstractTeam implements java.io.Serializable {

	// Fields

	/**
	 * 
	 */
	private static final long serialVersionUID = 7478662977867312988L;
	private Integer idTeam;
	private Departament departamentByIdDepartament2;
	private Departament departamentByIdDepartament3;
	private User user;
	private Departament departamentByIdDepartament1;
	private String teamName;
	private String teamImg;
	private Integer totalPoints;
	private String infoText;
	private Date heldDate;
	private Set<Teamranking> teamrankingsForIdTeam2 = new HashSet<Teamranking>(
			0);
	private Set<Teamranking> teamrankingsForIdTeam1 = new HashSet<Teamranking>(
			0);
	private Set<Teamranking> teamrankingsForIdTeam5 = new HashSet<Teamranking>(
			0);
	private Set<Userteam> userteams = new HashSet<Userteam>(0);
	private Set<Teamranking> teamrankingsForIdTeam4 = new HashSet<Teamranking>(
			0);
	private Set<Teamranking> teamrankingsForIdTeam3 = new HashSet<Teamranking>(
			0);

	// Constructors

	/** default constructor */
	public AbstractTeam() {
	}

	/** minimal constructor */
	public AbstractTeam(Departament departamentByIdDepartament2,
			Departament departamentByIdDepartament3, User user,
			Departament departamentByIdDepartament1, String teamName,
			Integer totalPoints, String infoText, Date heldDate) {
		this.departamentByIdDepartament2 = departamentByIdDepartament2;
		this.departamentByIdDepartament3 = departamentByIdDepartament3;
		this.user = user;
		this.departamentByIdDepartament1 = departamentByIdDepartament1;
		this.teamName = teamName;
		this.totalPoints = totalPoints;
		this.infoText = infoText;
		this.heldDate = heldDate;
	}

	/** full constructor */
	public AbstractTeam(Departament departamentByIdDepartament2,
			Departament departamentByIdDepartament3, User user,
			Departament departamentByIdDepartament1, String teamName,
			String teamImg, Integer totalPoints, String infoText,
			Date heldDate, Set<Teamranking> teamrankingsForIdTeam2,
			Set<Teamranking> teamrankingsForIdTeam1,
			Set<Teamranking> teamrankingsForIdTeam5, Set<Userteam> userteams,
			Set<Teamranking> teamrankingsForIdTeam4,
			Set<Teamranking> teamrankingsForIdTeam3) {
		this.departamentByIdDepartament2 = departamentByIdDepartament2;
		this.departamentByIdDepartament3 = departamentByIdDepartament3;
		this.user = user;
		this.departamentByIdDepartament1 = departamentByIdDepartament1;
		this.teamName = teamName;
		this.teamImg = teamImg;
		this.totalPoints = totalPoints;
		this.infoText = infoText;
		this.heldDate = heldDate;
		this.teamrankingsForIdTeam2 = teamrankingsForIdTeam2;
		this.teamrankingsForIdTeam1 = teamrankingsForIdTeam1;
		this.teamrankingsForIdTeam5 = teamrankingsForIdTeam5;
		this.userteams = userteams;
		this.teamrankingsForIdTeam4 = teamrankingsForIdTeam4;
		this.teamrankingsForIdTeam3 = teamrankingsForIdTeam3;
	}

	// Property accessors
	@GenericGenerator(name = "generator", strategy = "increment")
	@Id
	@GeneratedValue(generator = "generator")
	@Column(name = "idTeam", unique = true, nullable = false)
	public Integer getIdTeam() {
		return this.idTeam;
	}

	public void setIdTeam(Integer idTeam) {
		this.idTeam = idTeam;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "idDepartament2", nullable = false)
	public Departament getDepartamentByIdDepartament2() {
		return this.departamentByIdDepartament2;
	}

	public void setDepartamentByIdDepartament2(
			Departament departamentByIdDepartament2) {
		this.departamentByIdDepartament2 = departamentByIdDepartament2;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "idDepartament3", nullable = false)
	public Departament getDepartamentByIdDepartament3() {
		return this.departamentByIdDepartament3;
	}

	public void setDepartamentByIdDepartament3(
			Departament departamentByIdDepartament3) {
		this.departamentByIdDepartament3 = departamentByIdDepartament3;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "idUser", nullable = false)
	public User getUser() {
		return this.user;
	}

	public void setUser(User user) {
		this.user = user;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "idDepartament1", nullable = false)
	public Departament getDepartamentByIdDepartament1() {
		return this.departamentByIdDepartament1;
	}

	public void setDepartamentByIdDepartament1(
			Departament departamentByIdDepartament1) {
		this.departamentByIdDepartament1 = departamentByIdDepartament1;
	}

	@Column(name = "teamName", nullable = false, length = 25)
	public String getTeamName() {
		return this.teamName;
	}

	public void setTeamName(String teamName) {
		this.teamName = teamName;
	}

	@Column(name = "teamImg")
	public String getTeamImg() {
		return this.teamImg;
	}

	public void setTeamImg(String teamImg) {
		this.teamImg = teamImg;
	}

	@Column(name = "totalPoints", nullable = false)
	public Integer getTotalPoints() {
		return this.totalPoints;
	}

	public void setTotalPoints(Integer totalPoints) {
		this.totalPoints = totalPoints;
	}

	@Column(name = "infoText", nullable = false)
	public String getInfoText() {
		return this.infoText;
	}

	public void setInfoText(String infoText) {
		this.infoText = infoText;
	}

	@Temporal(TemporalType.DATE)
	@Column(name = "heldDate", nullable = false, length = 10)
	public Date getHeldDate() {
		return this.heldDate;
	}

	public void setHeldDate(Date heldDate) {
		this.heldDate = heldDate;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "teamByIdTeam2")
	public Set<Teamranking> getTeamrankingsForIdTeam2() {
		return this.teamrankingsForIdTeam2;
	}

	public void setTeamrankingsForIdTeam2(
			Set<Teamranking> teamrankingsForIdTeam2) {
		this.teamrankingsForIdTeam2 = teamrankingsForIdTeam2;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "teamByIdTeam1")
	public Set<Teamranking> getTeamrankingsForIdTeam1() {
		return this.teamrankingsForIdTeam1;
	}

	public void setTeamrankingsForIdTeam1(
			Set<Teamranking> teamrankingsForIdTeam1) {
		this.teamrankingsForIdTeam1 = teamrankingsForIdTeam1;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "teamByIdTeam5")
	public Set<Teamranking> getTeamrankingsForIdTeam5() {
		return this.teamrankingsForIdTeam5;
	}

	public void setTeamrankingsForIdTeam5(
			Set<Teamranking> teamrankingsForIdTeam5) {
		this.teamrankingsForIdTeam5 = teamrankingsForIdTeam5;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "team")
	public Set<Userteam> getUserteams() {
		return this.userteams;
	}

	public void setUserteams(Set<Userteam> userteams) {
		this.userteams = userteams;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "teamByIdTeam4")
	public Set<Teamranking> getTeamrankingsForIdTeam4() {
		return this.teamrankingsForIdTeam4;
	}

	public void setTeamrankingsForIdTeam4(
			Set<Teamranking> teamrankingsForIdTeam4) {
		this.teamrankingsForIdTeam4 = teamrankingsForIdTeam4;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "teamByIdTeam3")
	public Set<Teamranking> getTeamrankingsForIdTeam3() {
		return this.teamrankingsForIdTeam3;
	}

	public void setTeamrankingsForIdTeam3(
			Set<Teamranking> teamrankingsForIdTeam3) {
		this.teamrankingsForIdTeam3 = teamrankingsForIdTeam3;
	}

}